package com.b2.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;

/**
 * 
 * @TableName class
 */
@TableName(value ="class")
@ApiModel("班级信息收集")
public class Class implements Serializable {
    /**
     * 班级id
     */
    @ApiModelProperty("班级id")
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 幼儿园对应id
     */
    @ApiModelProperty("幼儿园id")
    @TableField("director_id")
    private Long directorId;

    /**
     * 班级名字
     */
    @ApiModelProperty("班级名字")
    private String name;

    /**
     * 用于老师加入班级得邀请码
     */
    @ApiModelProperty("老师邀请码")
    private String code1;

    /**
     * 用于家长加入班级得邀请码
     */
    @ApiModelProperty("家长邀请码")
    private String code2;

    /**
     * 班级属于哪个老师
     */
    @ApiModelProperty("老师id")
    @TableField("teacher_id")
    private Long teacherId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 班级id
     */
    public Long getId() {
        return id;
    }

    /**
     * 班级id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 幼儿园对应id
     */
    public Long getDirectorId() {
        return directorId;
    }

    /**
     * 幼儿园对应id
     */
    public void setDirectorId(Long directorId) {
        this.directorId = directorId;
    }

    /**
     * 班级名字
     */
    public String getName() {
        return name;
    }

    /**
     * 班级名字
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 用于老师加入班级得邀请码
     */
    public String getCode1() {
        return code1;
    }

    /**
     * 用于老师加入班级得邀请码
     */
    public void setCode1(String code1) {
        this.code1 = code1;
    }

    /**
     * 用于家长加入班级得邀请码
     */
    public String getCode2() {
        return code2;
    }

    /**
     * 用于家长加入班级得邀请码
     */
    public void setCode2(String code2) {
        this.code2 = code2;
    }

    /**
     * 班级属于哪个老师
     */
    public Long getTeacherId() {
        return teacherId;
    }

    /**
     * 班级属于哪个老师
     */
    public void setTeacherId(Long teacherId) {
        this.teacherId = teacherId;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Class other = (Class) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDirectorId() == null ? other.getDirectorId() == null : this.getDirectorId().equals(other.getDirectorId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getCode1() == null ? other.getCode1() == null : this.getCode1().equals(other.getCode1()))
            && (this.getCode2() == null ? other.getCode2() == null : this.getCode2().equals(other.getCode2()))
            && (this.getTeacherId() == null ? other.getTeacherId() == null : this.getTeacherId().equals(other.getTeacherId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDirectorId() == null) ? 0 : getDirectorId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getCode1() == null) ? 0 : getCode1().hashCode());
        result = prime * result + ((getCode2() == null) ? 0 : getCode2().hashCode());
        result = prime * result + ((getTeacherId() == null) ? 0 : getTeacherId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", directorId=").append(directorId);
        sb.append(", name=").append(name);
        sb.append(", code1=").append(code1);
        sb.append(", code2=").append(code2);
        sb.append(", teacherId=").append(teacherId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}